import {
    CORE_RULE_ADD,
    CORE_RULE_DELETE,
    CORE_RULE_LIST,
    CORE_RULE_UPDATE
} from '@/config/api'
import {
    ICoreRule,
    ICoreRuleDeleteParameter,
    ICoreRuleEditParameter
} from '@/types/core/rule'
import http from '@/utils/http'

export function coreRuleList() {
    return http.get<ICoreRule[]>(CORE_RULE_LIST)
}

export function coreRuleAdd(parameter: ICoreRuleEditParameter) {
    return http.post(CORE_RULE_ADD, parameter)
}

export function coreRuleUpdate(parameter: ICoreRuleEditParameter) {
    return http.post(CORE_RULE_UPDATE, parameter)
}

export function coreRuleDelete(parameter: ICoreRuleDeleteParameter) {
    return http.post(CORE_RULE_DELETE, parameter)
}
